/**
 * @Author: LIBOYA
 * @CreateDate: 2019/9/24
 * @Description:
 */
class ExceptionReason {
  static const int CONNECT_TIMEOUT = 1000;
  static const int SEND_TIMEOUT = 1001;
  static const int RECEIVE_TIMEOUT = 1002;
  static const int RESPONSE = 1003;
  static const int CANCEL = 1004;
  static const int DEFAULT = 1005;
  static const int DATA_ERROR = 1006;

  static String getErrMsg(int reason) {
    switch (reason) {
      case CONNECT_TIMEOUT:
        return "连接超时";
      case SEND_TIMEOUT:
        return '请求超时';
      case RESPONSE:
        return '服务异常';
      case RECEIVE_TIMEOUT:
        return '接收超时';
      case CANCEL:
        return '请求取消';
      case DATA_ERROR:
        return '数据格式异常';
    }
    return '未知错误';
  }
}
